package com.zhouxiaoge.abstractfactorypattern;

import com.zhouxiaoge.abstractfactorypattern.factory.AbstractFactory;
import com.zhouxiaoge.abstractfactorypattern.interfaces.Color;
import com.zhouxiaoge.abstractfactorypattern.interfaces.Shape;

public class AbstractFactoryPatternDemo {
    public static void main(String[] args) {

        AbstractFactory shapeFactory = FactoryProducer.getFactory("shape");

        Shape circle = shapeFactory.getShape("circle");
        circle.draw();

        Shape rectangle = shapeFactory.getShape("rectangle");
        rectangle.draw();

        Shape square = shapeFactory.getShape("square");
        square.draw();

        AbstractFactory colorFactory = FactoryProducer.getFactory("color");

        Color red = colorFactory.getColoor("red");
        red.fill();

        Color green = colorFactory.getColoor("green");
        green.fill();

        Color blue = colorFactory.getColoor("blue");
        blue.fill();


    }
}
